package com.ndp.fb.mongo.api;

import java.util.List;

import com.alibaba.fastjson.JSONObject;
import com.ndp.fb.mongo.model.autocreatead.AdMarketTarget;
import com.ndp.fb.mongo.model.autocreatead.robot.AdInfoForStrategy;
import com.ndp.fb.mongo.model.autocreatead.robot.MarketingTargetStrategy;
import com.ndp.fb.rdb.model.Pager;

/**
 * Created by Elvis on 2016/6/6.
 */
public interface AdMarketTargetMongoService {

    /**
     * 保存广告营销目标
     * @param adMarketTarget
     * @return
     */
	String save(AdMarketTarget adMarketTarget);

    /**
     * 获取全部广告营销目标
     * @return
     */
    List<AdMarketTarget> getAllList();
    
    /**
     * 获取指定feed下的营销目标广告营销目标
     * @return
     */
    List<AdMarketTarget> getAdMarketTargetByFeedId(Long wefeedId);

    /**
     * 更新ad营销目标
     * @param adMarketTarget
     */
    void updateAdMarketTarget(AdMarketTarget adMarketTarget);

    /**
     * 更新ad营销目标 status
     * @param adMarketTarget
     */
    void updateAdMarketTargetStatus(String id,Integer status, String attribution);
    /**
     * 返回营销目标
     * @param startIndex
     * @param pageSize
     * @return
     */
     Pager<AdMarketTarget> getMarketTarget(Integer startIndex,Integer pageSize);

    /**
     * 给营销目标下push 新的营销策略，如果已经存在，不在push，判断是否存在以 strategyRuleSpecificId 为准，
     * @param marketingTargetStrategy
     */
     void pushMarketingTargetStrategy(MarketingTargetStrategy marketingTargetStrategy,String adMarketTargetId);


    void pushAdInfo(AdInfoForStrategy adInfoForStrategy,String strategyRuleSpecificId,String adMarketTargetId);
    void updateAdInfo(AdInfoForStrategy adInfoForStrategy,String adMarketTargetId);
    AdMarketTarget findByMarketingId(String mtId);
    
    /**
     * 保存广告营销目标
     * @param adMarketTarget
     * @return
     */
	String saveAdMarketTargetParam(JSONObject param);
	void updateAdMarketTargetParamStatus(String id,String status);
	List<JSONObject> findWaitPublishAdMarketTargetParam();
}
